package com.clive.ttweb.controller;

import com.clive.ttweb.bean.DishesCategory;
import com.clive.ttweb.service.DishesCategoryService;
import com.clive.ttweb.vo.DishResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/category")
@CrossOrigin
@RestController
public class DishCategoryController {
    @Autowired
    private DishesCategoryService categoryService;
    @RequestMapping("/all")
    public DishResult findCategoryAll(){
        List<DishesCategory> list = categoryService.findCategoryAll();
        return DishResult.ok().data("categorys",list);
    }
}
